layui.use('carousel', function(){
  var carousel = layui.carousel;
  //建造实例
  carousel.render({
    elem: '#test'
    ,width: '800px' 
    ,height: '500px'
    ,arrow: 'always' //始终显示箭头
    ,anim: 'default' //切换动画方式
    ,autoplay: true
    ,interval: 3000
    ,indicator: 'inside'
  });
});